<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class GoodsType extends Model
{
    use SoftDeletes;
    protected $table = 'goods_type';
    protected $fillable=[ 'name', 'sort' ];

    public function manyParams()
    {
        return $this->belongsToMany(GoodsParames::class,'goods_type_params','type_id','params_id');
    }

    public function manyAttributes()
    {
        return $this->belongsToMany(GoodsAttributes::class,'goods_type_attributes','type_id','attribute_id');
    }
}
